dofile ("libGame.lua")

anims = {
{0, 1, 2, 1},
{3, 4, 5, 4},
{6, 7, 8, 7},
{9, 10, 11, 10}}

vitesses = {300, 300, 300, 300}
Game.Sprite.new ("images/Sonic.png", 24, 32, VRAM, anims, vitesses, SCREEN_DOWN, 5, 5, "Sonic", 2)

while not Keys.held.Start do
  
  Controls.read ()
  
  startDrawing ()
    
    Game.Sprite.draw ("Sonic")
    
    if Keys.held.Up then
      Game.Sprite.moveUp ("Sonic", 1)
    end
    if Keys.held.Down then
      Game.Sprite.moveDown ("Sonic", 1)
    end
    if Keys.held.Left then
      Game.Sprite.moveLeft ("Sonic", 1)
    end
    if Keys.held.Right then
      Game.Sprite.moveRight ("Sonic", 1)
    end
    
  stopDrawing ()
  
end

Game.clearMemory ()
